% a test app to work with camera functions
close all
clear all
dbstop if error


x = [0 1 0 1 0 1 0 1]';
y = [0 0 1 1 1 0 0 1]';
z = [0 0 0 0 1 1 1 1]'+2;

x = [x; (x-2); (x+2); x; x+4; x; x-2; x];
y = [y;  y; y+2; y+2; y+2; y-2; y-2; y];
z = [z; z-1;z; z+1; z; z; z; z-4]+5;

figure;
fig1 = gcf;
figure(fig1);
plot3(x,y,z,'.r')
set( gca, 'Projection', 'perspective');
%camproj('perspective');

figure;
fig2 = gcf;
figure(fig2);
plot3(x,y,z,'.r');
pos2 = [-20 -20 40];
tar2 = [0 0 0];
set( gca, 'Projection', 'perspective','CameraPosition',pos2,'CameraTarget',tar2);

figure;
fig3 = gcf;
figure(fig3);
plot3(x,y,z,'.r');
pos2 = [20 20 40];
tar2 = [0 0 0];
set( gca, 'Projection', 'perspective','CameraPosition',pos2,'CameraTarget',tar2);

